<template>
  <footer class="footer" v-show="listResidue">
    <span class="todo-count" v-show="residue"
      ><strong>{{ residue }}</strong
      >剩余</span
    >
    <ul class="filters">
      <li>
        <a
          :class="{ selected: type === 'listAll' }"
          href="#/"
          @click="screen('listAll')"
          >全部</a
        >
      </li>
      <li>
        <a
          :class="{ selected: type === 'active' }"
          href="#/active"
          @click="screen('active')"
          >进行中</a
        >
      </li>
      <li>
        <a
          :class="{ selected: type === 'completed' }"
          href="#/completed"
          @click="screen('completed')"
          >已完成</a
        >
      </li>
    </ul>
    <button class="clear-completed" @click="delListAll" v-show="complete">清除已完成</button>
  </footer>
</template>

<script>
export default {
  name: 'Bottom',
  props: {
    residue: {
      type: Number,
      require: true
    },
    type: {
      type: String,
      require: true
    },
    listResidue: {
      type: Number,
      require: true
    },
    complete: {
      type: Number,
      require: true
    }
  },
  methods: {
    screen (type) {
      this.$emit('screen', type)
    },
    delListAll () {
      this.$emit('delListAll')
    }
  }
}
</script>

<style scoped lang="less"></style>
